package com.zmm.weblog.web.cglib;

import java.io.*;

public class IOTest {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        //out();
        in();
    }
 
    public static void out() throws IOException {
        ObjectOutputStream oos = new ObjectOutputStream(
                new FileOutputStream("E:\123.txt"));
        Person person = new Person("张三",18);
 
        oos.writeObject(person);
        oos.close();
    }
 
    public static void in() throws IOException, ClassNotFoundException {
        ObjectInputStream ois = new ObjectInputStream(
                new FileInputStream("E:\123.txt")
        );
        Object object = ois.readObject();
        System.out.println(object);
    }}
